package com.gt.quality.system.entity.mock;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gt.quality.base.pojo.CommonTableInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.BooleanTypeHandler;

import java.io.Serializable;

/**
 * MyBatis 会自动将 is_active 列的 0 和 1 映射为 false 和 true
 */
@EqualsAndHashCode(callSuper = true)
@Schema(title = "模拟器", description = "EasyCode")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "mock_info", autoResultMap = true)
public class MockInfo extends CommonTableInfo implements Serializable {
    /**
     * Description:  用户ID
     */
    @Schema(title = "mock_id",description = "mock_id")
    @TableId(value = "mock_id", type = IdType.ASSIGN_ID)
    private Long mockId;

    @Schema(title = "interface_router", description = "接口路径")
    @TableField(value = "interface_router")
    private String interfaceRouter;

    @Schema(title = "reqMethod", description = "请求方式:post/get/put/delete")
    @TableField(value = "req_method")
    private String reqMethod;

    @Schema(title = "blockedTime", description = "延时返回时间-毫秒")
    @TableField(value = "blocked_time")
    private long blockedTime;

    @Schema(title = "enableBlockedTime", description = "开启延时返回")
    @TableField(value = "enable_blocked_time",typeHandler = BooleanTypeHandler.class)
    private boolean enableBlockedTime;

    @Schema(title = "responseBody", description = "响应Body")
    @TableField(value = "response_body")
    private String responseBody;

    @Schema(title = "checkedHeader", description = "校验Header")
    @TableField(value = "checked_header")
    private String checkedHeader;

    @Schema(title = "enableHeaderCheck", description = "开启校验Header")
    @TableField(value = "enable_header_check",typeHandler = BooleanTypeHandler.class)
    private boolean enableHeaderCheck;

}
